package com.aaa.ssm.service.impl;

import com.aaa.ssm.dao.LoginLogDao;
import com.aaa.ssm.entity.LoginLog;
import com.aaa.ssm.service.LoginLogService;
import com.aaa.ssm.util.Page;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;
import java.util.Map;

/**
 * @ fileName:loginLogServiceImpl
 * @ description:
 * @ createTime:2023/3/25 11:05
 * @ version:1.0.0
 */
@Service
public class LoginLogServiceImpl implements LoginLogService {

    @Resource
    private LoginLogDao loginLogDao;

    public PageInfo queryLoginLog(Page<LoginLog> page) {
        //设值页码和每页显示数量
        PageHelper.startPage(page.getPageNo(),page.getPageSize());
        //实例化pageinfo   把查询结果作为参数放入里面
        return new PageInfo(loginLogDao.queryLoginLog(page.getData()));
    }
    public List<Map> queryAll(String queryTime) {
        return loginLogDao.queryAll(queryTime);
    }
}

